
#ifndef INPUTCOM_H
#define INPUTCOM_H

#include "InputInterface.h"
#include <map>
#include "assert.h"

#define NUMKEYS 512 //Should cover any usage


/*! \class Input
\brief A class to handle userinput
*/
class Input : public InputInterface
{
public:
	bool initialise();											//!< initialise the input
																//!< \return returns true on success
	void keyInput( bool down, int key );						//!< tells the input class that a key has either been pressed or released
																//!< \param down True if pressed False if released
																//!< \param key key index of the pressed key

	char getKeyStatus( int key )	{	return mKeys[key];	}	
	bool assignActionToKey( int action, int key );				//!< assigned an action to a key input
																//!< \param action The action to assign
																//!< \param key The key that triggers the action as pressed/released
	void removeAction( int action );
	void clearActionAssignments();
	inputReturnData getActionInput( int action );				//!< ask what the current status of an action is
																//!< \param action The action in question
																//!< \return structure about the status of the action

	//( should be done last at end of frame )
	void update();												//!< update the input class. This function should be called once per frame
																//!< every frame and at the end of the frame or beginning.

	std::map<int,int> mActionMap; // int action, int key
	char mKeys[NUMKEYS];


//----------------------------------------------------------------------------

public:
	Input() 
	{ 
		for(int i=0; i<NUMKEYS; ++i ) 
			mKeys[i] = keyNA; 
	}
	~Input();

};


#endif
